#pragma once
#include <vector>
#include <string>
#include <cassert>

#include "string_math.hpp"

const uint8_t COMMA_SEPARATED_PARTS_NUM = 5;


std::string extract3dCoordinate(const std::string& point_line)
{
    std::vector<std::string> splits = SplitString(point_line, ',');
    assert(splits.size() == COMMA_SEPARATED_PARTS_NUM);

    return JoinString(",", {splits[2], splits[3], splits[4]});
}


std::vector<String3DPoint> LoadData(const std::vector<std::string>& point_lines)
{
    std::vector<String3DPoint> str_points;

    for (std::string line : point_lines) {
        str_points.push_back(
            String3DPoint(
                extract3dCoordinate(line)
            )
        );
    }

    return str_points;
}